package com.hns.can.master.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hns.can.common.domain.GridPage;
import com.hns.can.common.vo.CommonParamsVo;
import com.hns.can.common.web.BaseController;
import com.hns.can.master.entity.SysMsgAlm;
import com.hns.can.master.entity.SysMsgCarspding;
import com.hns.can.master.entity.SysMsgDrvbhv;
import com.hns.can.master.entity.SysMsgWorktime;
import com.hns.can.master.service.AlarmPushSettingService;
import com.hns.can.master.vo.AlarmSettingParamVo;
import com.hns.frame.mybatis.Pagination;
/**
 * 报警设置controller
 * @author:zhangy
 * @email:zhangyu2222z@sina.cn
 * @version Revision 2.0.0
 */
@Controller
@RequestMapping("alarmPushSetting")
public class AlarmPushSettingController extends BaseController {
	
	@Autowired
	private AlarmPushSettingService alarmPushSettingService;
	
	/**
	 * 报警时间设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("setAlarmTime")
	@ResponseBody
	public Object setAlarmTime(SysMsgWorktime params){
		alarmPushSettingService.setAlarmTime(params);
		return this.getReturnResult();
	}
	
	/**
	 * 查询报警时间设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("searchAlarmTimeSetting")
	@ResponseBody
	public Object searchAlarmTimeSetting(CommonParamsVo params){
		List<SysMsgWorktime> searchAlarmTimeSetting = alarmPushSettingService.searchAlarmTimeSetting(params);
		return this.getReturnResult(searchAlarmTimeSetting);
	}
	
	/**
	 * 行为报警设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("setAlarmUnsafe")
	@ResponseBody
	 public Object setAlarmUnsafe(SysMsgDrvbhv params){
		 alarmPushSettingService.setAlarmUnsafe(params);
		 return this.getReturnResult();
	 }
	
	/**
	 * 查询不安全行为设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("searchAlarmUnsafeSetting")
	@ResponseBody
	public Object searchAlarmUnsafeSetting(SysMsgDrvbhv params){
		List<SysMsgDrvbhv> list = alarmPushSettingService.searchAlarmUnsafeSetting(params);
		return this.getReturnResult(list);
	}
	
	/**
	 * 超速报警设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("setAlarmSpeed")
	@ResponseBody
	 public Object setAlarmSpeed(SysMsgCarspding params){
		 alarmPushSettingService.setAlarmSpeed(params);
		 return this.getReturnResult();
	 }
	
	/**
	 * 查询超速行为设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("searchAlarmSpeedSetting")
	@ResponseBody
	public Object searchAlarmSpeedSetting(SysMsgCarspding params){
		List<SysMsgCarspding> list = alarmPushSettingService.searchAlarmSpeedSetting(params);
		return this.getReturnResult(list);
	}
	
	/**
	 * 	故障报警过滤设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("setAlarmFault")
	@ResponseBody
	public Object setAlarmFault(AlarmSettingParamVo params){
		alarmPushSettingService.setAlarmFault(params);
		return this.getReturnResult();
	}
	
	/**
	 * 	故障报警设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("setNotAlarmFault")
	@ResponseBody
	public Object setNotAlarmFault(AlarmSettingParamVo params){
		alarmPushSettingService.setNotAlarmFault(params);
		return this.getReturnResult();
	}
	
	/**
	 * 	查询故障报警设置
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("searchAlarmFault")
	@ResponseBody
	public Object searchAlarmFault(AlarmSettingParamVo params){
		Pagination page = alarmPushSettingService.searchAlarmFault(params);
		GridPage grid = new GridPage(page);
		return this.getReturnResult(grid);
	}
	
}
